package com.eusun.design.proxy.demo1;

import java.lang.reflect.Proxy;

public class Client {
    public static void main(String[] args) {
        RealSubject subject = new RealSubject();
        MyInvocationHandler handler = new MyInvocationHandler(subject);
        Subject proxyClass = (Subject) Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(), new Class[]{Subject.class}, handler);
        proxyClass.sellBooks();
        proxyClass.speak();
    }
}
